﻿// JavaScript Document
/*********************************/
/**********用户收货地址************/
/********************************/
var formApp= angular.module('formApp',[]);
formApp.controller('formController',function($scope){
	
	$scope.formData = {};	
	$scope.userinfo = {};
		
	
	//加载收货地址
	$scope.loadAddress = function()
	{		
		 
		$http.post(SGA.webroot + 'zxpx/ZxpxKcxxMgrAction!list', {formData: $scope.formData}, {
            headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
            transformRequest: function(data) {
                var qry = angular.isObject(data) && String(data) !== '[object File]' ? requestParam(data) : data;
                return qry;
            }
        }).success(function(data) {
            if (data.success == 'true') {                
                $scope.userinfo = data.rows;
            }
            else {
                alert(data.msg);
            }
        }).error(function(data) {
            alert('网络异常!');
        });
		 
	}	
	
	//添加收货地址
	$scope.addAddress = function()
	{		
		 
		$http.post(SGA.webroot + 'zxpx/ZxpxKcxxMgrAction!list', {formData: $scope.formData}, {
            headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
            transformRequest: function(data) {
                var qry = angular.isObject(data) && String(data) !== '[object File]' ? requestParam(data) : data;
                return qry;
            }
        }).success(function(data) {
            if (data.success == 'true') {                
                $scope.userinfo = data.rows;
            }
            else {
                alert(data.msg);
            }
        }).error(function(data) {
            alert('网络异常!');
        });
		 
	}	
	
});